import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class ErabiltzaileAukerak extends Frame{
	Frame nireFrame;
	String izena;
	String pasahitza;
	public ErabiltzaileAukerak(Frame parent, Boolean modal, String i, String p) {
		nireFrame = parent;
		izena = i;
		pasahitza = p;
		enableEvents(AWTEvent.WINDOW_EVENT_MASK);
		try {
			jbInit();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
	private void jbInit() throws Exception {
		final JFrame f = new JFrame();
		Container container = f.getContentPane();
		container.setLayout(null);
		((JPanel)container).setBorder(BorderFactory.createTitledBorder("Zereginak"));
		JButton produktuak = new JButton("Produktuak");
		produktuak.setBounds(20, 50, 100, 25);
		f.add(produktuak);
		JButton eskaerak = new JButton("Nire eskaerak");
		eskaerak.setBounds(150, 50, 120, 25);
		f.add(eskaerak);
		JButton datuak = new JButton("Datu pertsonalak aldatu");
		datuak.setBounds(50, 90, 190, 25);
		f.add(datuak);
		JButton irten = new JButton("Irten");
		irten.setBounds(170, 220, 100, 25);
		f.add(irten);
		f.setSize(300,300);
		f.setTitle("Euskaltoy");
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		produktuak.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(ActionEvent e) {
				produktuak_actionPerformed(e);
				f.setVisible(false);
			}
		});
		eskaerak.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(ActionEvent e) {
				eskaerak_actionPerformed(e);
				f.setVisible(false);
			}
		});
		datuak.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(ActionEvent e) {
				datuak_actionPerformed(e);
				f.setVisible(false);
			}
		});
		irten.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(ActionEvent e) {
				irten_actionPerformed(e);
				f.setVisible(false);
			}
		});
	}
	void produktuak_actionPerformed(ActionEvent e) {
		new ProduktuakKautotuta(this, true, izena, pasahitza);
	}
	void eskaerak_actionPerformed(ActionEvent e) {
		new Eskaera(this, true, izena, pasahitza);
	}
	void datuak_actionPerformed(ActionEvent e) {
		new DatuakAldatu(this, true);
	}
	void irten_actionPerformed(ActionEvent e) {
		new Frame1();
	}
}